#ifndef _MESSAGEHANDLER_H_
#define _MESSAGEHANDLER_H_

#include <iostream>
#include <string>
#include <unordered_map>
#include <functional>
#include "musicServer.h"
#include "stdTcpService.h"

class MessageHandle
{
public:
    using HandlerFunction = std::function<void(const std::string &)>;
    //构造函数
    MessageHandle(const StdTcpSocket & clientSocket);
public:
    void handleMessage(const std::string &data);
   
private:
    std::unordered_map<int, HandlerFunction> m_handles;
    MusicServer m_musicServer;
    StdTcpSocket  m_clientSocket;
    
};

#endif